import  QGuanRunApplication from "./qguan.js"
import RootLoad from "./root/RootLoad";
import Jsr from "../jsr/Jsr";
import  run from "./run/Run.js"
import  runJsr from "./run/RunJsr.js"
import  AopFactory from "./AopFactory.js"
import  jsrLoad from "./run/jsrLoad.js"
const path = require('path');
const fs = require('fs');

let apackPath=path.join(__dirname,'../../../../');
let packtmp= fs.readFileSync(path.join(apackPath,'/tmp/pack1.tmp') ,'utf-8' );   //临时文件
let packList=packtmp.split("\r\n");
let patmp0=packList[0].split(",")
let patmp1=packList[1].split(",")

const inBrowser = typeof window !== 'undefined'
new QGuanRunApplication()

let jsr=new Jsr();
let   root =     RootLoad(inBrowser,patmp0[0]);
root.then((root1)=>{

    qguan('root',root1,null,"save");
    qguan('jsr',jsr,null,"save");
/*    qguan("run",run,null,"save");
    qguan("runJsr",runJsr,null,"save");*/
    let aopFactory=new AopFactory();
    qguan('comm',patmp1,null,"save")
    qguan("jsrLoad",jsrLoad,null,"save");
    qguan("aopFactory",aopFactory,null,"save");
    qguan('qguan',"",'qguan','jsrLoad')
 //   qguan(patmp1[0],patmp1[1],patmp1[2],patmp1[3])
})
